<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

<div id="page-title">

    <h3>
        <#if category>修改页面分类<#else>添加页面分类</#if>
    </h3>
</div>
<div class="pad10A">
<form id="demo-form1" action="/page/category/save" class="col-md-12" method="POST">
	<#if category>
	<input type="hidden" name="id" value="${category.id}"/>
	</#if>
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                上级名称:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-3">
        	<select name="parent.id">
        		<option value="">无</option>
        		<#list list.list as c>
        		<option value="${c.id}" <#if category.parent.id == c.id ||pid == c.id>selected</#if>>${c.name}</option>
        		</#list>
        	</select>
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                分类名称:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-3">
            <input type="text" id="name" name="name"  data-trigger="change" data-required="true" class="parsley-validated" value="${((category.name)!'')?xhtml}">
        </div>
    </div>
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                序号:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-3">
            <input type="text" id="sequnce" name="sequnce"  data-type="number" data-trigger="change" data-required="true" class="parsley-validated"  value="${category.sequnce}">
        </div>
    </div>
    <div class="divider"></div>
    <div class="form-row">
        <input type="hidden" name="superhidden" id="superhidden">
       <div class="form-input col-md-10 col-md-offset-2">
                    <a href="javascript:;" class="btn medium primary-bg radius-all-4 col-md-2" id="demo-form-2-valid">
                        
                                                                         提交
                        
                 </a>
        </div>
    </div>   

</form>
</div>

</div>
<script>
$(function(){
    $("#demo-form-2-valid").click(function(){
    	$('#demo-form1').parsley('validate');
    	$('#demo-form1').trigger('submit');
    });
    
})
</script>